<?php 
require_once 'sesi_login.php';
require_once 'konfigurasi.php';

fungsi('pengguna');

define('PAGE', 'Latihan');
define('PAGE_ICO', 'icon-stats');
define('PAGE_URL', 'latihan.php');

panggil_header();
koneksi_buka();

$id_siswa = ID_SISWA;
?>

<div class="content">
                
	<div class="page-header">
		<div class="icon">
			<span class="ico-arrow-right"></span>
		</div> 
		<h1> Latihan<small>SDN I</small></h1>
	</div>
	

	<div class="row-fluid">
		<div class="span12">                

			<div class="block">
				<div class="head">                                
					<h2>Pencarian Latihan</h2>
					<ul class="buttons">             
						<li><a href="#" onClick="source('form_pa'); return false;"><div class="icon"><span class="ico-info"></span></div></a></li>
					</ul>                                                                  
				</div>                                    
				<div class="data-fluid">
					<div class="row-form">
						<div class="span3">Materi</div>
						<div class="span9">
							<select name="materi" class="select" style="width: 100%;">
								<?php 
									$text_q_materi = "select *, a.id as m_id, a.nama as m_nama, b.nama as k_nama 
													from materi a left join kelas b on a.tipe_kelas = b.tipe 
													left join siswa c on b.id = c.kelas
													where c.id = ".ID_SISWA;
									
									$q_materi = mysql_query($text_q_materi);
									while($dt_materi = mysql_fetch_array($q_materi)){?>
										<option value="<?php echo $dt_materi['m_id']; ?>"><?php echo $dt_materi['m_nama'].", kelas ".$dt_materi['k_nama'].", pertemuan ke ".$dt_materi['pertemuan_ke'];?></option>
								<?php 
									} ?>                                                                 
							</select>
						</div>
					</div>					<div class="row-form">
						<div class="span3">Latihan</div>
						<div class="span9">
							<select name="soal" class="select" style="width: 100%;">
								<?php 
									$text_q_soal = "select * from soal";
									
									$q_soal = mysql_query($text_q_soal);
									while($dt_soal = mysql_fetch_array($q_soal)){?>
										<option value="<?php echo $dt_soal['id']; ?>"><?php echo $dt_soal['nama'];?></option>
								<?php 
									} ?>                                                                    
							</select>
						</div>
					</div>                  
					
					<div class="row-form">
						<div class="span3"></div>
						<div class="span9">  
							<input type="hidden" name="id_siswa" value="<?php echo $id_siswa; ?>"/>
							<button id="btn-mulai" class="btn btn-primary" type="button">Mulai</button>  		
							<button class="btn btn-warning" type="button">Batal</button>       
						</div>   
					</div>
				</div>        
			</div>
		</div>  
	</div> 

</div>
<div class="dialog" id="source" style="display: none;" title="Source"></div>

<?php
panggil_footer();
?>
